<template>
  <div class="dialog-container">
    <el-dialog
      v-bind:title="title"
      :visible.sync="visible"
      @close="$emit('update:show', false)"
      :show="show">
      <span>{{content}}</span>
      <el-button @click="$emit('update:show', false)" >取 消</el-button>
      <el-button type="primary" @click="saveConfirm()">确&nbsp;定</el-button>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data () {
    return {
      visible: this.show
    };
  },
  props: {
    show: {
      type: Boolean,
      default: false
    },
    title: '',
    content: ''
  },
  methods: {
    saveConfirm () {
      this.$emit('save-confirm');
    }
  },
  watch: {
    show () {
      this.visible = this.show;
    }
  }
};
</script>
